<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>打印三角形</title>
</head>
<body>

<script>

    for(var j =0;j<=5;j++) {
        for (var i = 0; i <=j; i++) {
            document.write("*");
        }
        document.write("<br>");
    }

</script>

</body>
</html>